/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.qy.service;

import java.util.List;

import com.thinkgem.jeesite.modules.qy.dto.LoginDto;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.qy.entity.QyUser;
import com.thinkgem.jeesite.modules.qy.dao.QyUserDao;

/**
 * 用户Service
 * @author JohnShen
 * @version 2016-11-24
 */
@Service
@Transactional(readOnly = true)
public class QyUserService extends CrudService<QyUserDao, QyUser> {

	public QyUser get(String id) {
		return super.get(id);
	}
	
	public List<QyUser> findList(QyUser qyUser) {
		return super.findList(qyUser);
	}
	
	public Page<QyUser> findPage(Page<QyUser> page, QyUser qyUser) {
		return super.findPage(page, qyUser);
	}
	
	@Transactional(readOnly = false)
	public void save(QyUser qyUser) {
		super.save(qyUser);
	}
	
	@Transactional(readOnly = false)
	public void delete(QyUser qyUser) {
		super.delete(qyUser);
	}

	public QyUser validateUser(LoginDto loginDto){
		return dao.validateUser(loginDto);
	}

	//根据用户名查找用户
	public QyUser getUserByLoginName(QyUser user){
		return dao.getUserByLoginName(user);
	}
}